package com.tebiecloud.base.server.mapper;

import com.tebiecloud.base.client.model.StorefVo;
import com.tebiecloud.base.client.model.entity.BaseAccount;
import com.tebiecloud.common.mybatis.base.mapper.SuperMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 登录账号 Mapper 接口
 *
 * @author tebie
 * @date 2019-08-08
 */
@Repository
public interface BaseAccountMapper extends SuperMapper<BaseAccount> {


    @Select("SELECT b.user_id ,b.mobile ,b.nick_name ,b.status ,b.sex,b.ct ，COUNT(*)AS total FROM base_user AS b  JOIN base_account AS ba ON ba.user_id=b.user_id WHERE account_type='agm' GROUP BY user_id LIMIT #{page},#{limit} ")
    List<StorefVo> agm(@Param("page") Integer page, @Param("limit") Integer limit);

}
